package com.ebt.m.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.ebt.m.R;


/**
 *
 */
public class EmptyView extends RelativeLayout {
    private TextView textView;

    public EmptyView(Context context) {
        this(context, null);
    }

    public EmptyView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public EmptyView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    private void init(Context context) {
        inflate(context, R.layout.widget_simple_textview, this);
        textView = (TextView) findViewById(R.id.simple_text);
    }

    public void setData(String txt, int res) {
        textView.setText(txt);
        if (res != 0) {
            textView.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(res), null, null);
        }
    }
}
